package com.chenfan.process.enums;

import java.util.Objects;

import lombok.Getter;

/**
 * @author K
 * @date 2021-06-10
 */
public enum BooleanEnum {

    N(0, "NO"), Y(1, "YES"),;

    @Getter
    private Integer code;
    @Getter
    private String message;

    BooleanEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static Integer getValue(Boolean isEdit) {
        return Objects.equals(isEdit, true) ? BooleanEnum.Y.getCode() : BooleanEnum.N.getCode();
    }
}
